<?php
//+---------------------------------------------------------------------------------------------------------------------
//| 人生是荒芜的旅行，冷暖自知，苦乐在心
//+---------------------------------------------------------------------------------------------------------------------
//| Author:Janmas <janmas@126.com>
//+---------------------------------------------------------------------------------------------------------------------
//| 
//+---------------------------------------------------------------------------------------------------------------------


namespace app\common\event;


use think\facade\Config;

/**
 * 把系统配置读取到Config
 * @package app\common\event
 */
class ConfigEvent
{
	public function __construct(){
		$this->load();
	}

	protected function load(){
		Config::load(app()->getConfigPath().'html.'.app()->getConfigExt(),'html');
		$config = \app\admin\model\Config::getConfigCache();
		$group = array_keys($config);
		array_map(function($item)use($config){
			Config::set($config[$item],$item);
		},$group);
	}
}